package com.soft.javase.day06.object.deepcopy;

/**
 * @author yzh
 * @desc TODO
 * @date 2025/4/24
 */
public class Test {
    public static void main(String[] args) throws CloneNotSupportedException {
        Phone phone = new Phone("苹果", 8000.0);
        Person p1 = new Person("李四", 25,phone);
        Person p2 = p1.clone();
        System.out.println("克隆后，修改前");
        System.out.println(p1);
        System.out.println(p2);
        System.out.println("克隆后，修改后");
        p1.setAge(24);
        phone.setPrice(9000.0);
        System.out.println(p1);
        System.out.println(p2);
    }
}
